<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<div class="pageHeader">
    <form id="pagerForm" action="${ctx }/version/list" method="post"
          onsubmit="return navTabSearch(this);">
        <div class="searchBar">
            <table class="searchContent">
                <tbody>
                <!--分页输入-->
                <input type="hidden" name="pageNum" value="1"/>
                <input type="hidden" name="numPerPage" value="${pageParam.pageSize eq null ? 20 : pageParam.pageSize}"/>
                <tr>
                    <td>
                        <label>客户端类型：</label>
                        <select name="clientType" maxlength="50">
                            <option value="">
                                未选择
                            </option>
                            <option value="1"
                                    <c:if test="${pageParam.clientType eq '1'}">selected="selected"</c:if>>学生端
                            </option>
                            <option value="2"
                                    <c:if test="${pageParam.clientType eq '2'}">selected="selected"</c:if>>老师端
                            </option>
                        </select>
                    </td>
                    <td>
                        版本号：<input name="version" value="${pageParam.version}"/>
                    </td>
                    <td>
                        <label>系统类型：</label>
                        <select name="osType" maxlength="50">
                            <option value="">
                                未选择
                            </option>
                            <option value="ios"
                                    <c:if test="${pageParam.osType eq 'ios'}">selected="selected"</c:if>>IOS
                            </option>
                            <option value="android"
                                    <c:if test="${pageParam.osType eq 'android'}">selected="selected"</c:if>>Android
                            </option>
                        </select>
                    </td>
                    <td>
                        渠道：<input name="channels" value="${pageParam.channels}"/>
                    </td>

                </tr>
                </tbody>
            </table>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">搜索</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>

<div class="panelBar">
    <ul class="toolBar">
        <li>
            <a class="add" href="${ctx }/version/addBefore" target="dialog" mask="true" rel="user_add"
               height="450" width="500" title="新增版本">
                <span>新增版本</span>
            </a>
        </li>
    </ul>
</div>
<table class="table" width="2000" layoutH="137">
    <thead>
    <tr>
        <th style="width:5%">客户端类型</th>
        <th style="width:5%">客户端版本</th>
        <th style="width:5%">渠道信息</th>
        <th style="width:5%">系统类型</th>
        <th style="width:5%">OS适用最低版本</th>
        <th style="width:5%">OS适用最高版本</th>
        <th style="width:15%">下载地址</th>
        <th style="width:5%">是否需要强制升级</th>
        <th style="width:10%">版本升级说明</th>
        <th style="width:5%">创建时间</th>
        <th style="width:5%">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${records}" var="record" varStatus="status">
        <tr>
            <td>
                <c:if test="${record.clientType == 1 }">
                    <div>学生端</div>
                </c:if>
                <c:if test="${record.clientType == 2 }">
                    <div>老师端</div>
                </c:if>
            </td>
            <td>
                <div>${record.version}</div>
            </td>
            <td>
                <div>${record.channels}</div>
            </td>
            <td>
                <div>${record.osType}</div>
            </td>
            <td>
                <div>${record.osLowVersion}</div>
            </td>
            <td>
                <div>${record.osHighVersion}</div>
            </td>
            <td>
                <div>${record.downloadUrl}</div>
            </td>
            <td>
                <c:choose>
                    <c:when test="${beforceupdate}"> 是
                    </c:when>
                    <c:otherwise>  否
                    </c:otherwise>
                </c:choose>
            </td>
            <td>
                <div>${record.remark}</div>
            </td>
            <td><fmt:formatDate value="${record.createdTime}" type="both"
                                pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td>
                <a href="${ctx }/version/updateBefore/${record.id}.do" target="dialog" mask="true"
                   rel="edit_versilon"
                   resizable="false" maxable="false" minable="false"
                   title="编辑版本" height="450" width="500" class="btnEdit">编辑版本</a>
                <a href="${ctx }/version/doDelete/${record.id}.do"
                   target="ajaxTodo" class="btnDel"
                   title="确定要删除吗?">删除</a>
            </td>
    </c:forEach>
    </tbody>
</table>

<!--分页页面组件 -->
<div class="panelBar">
    <div class="pages">
        <span>每页</span>
        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
            <option value="20" ${pageParam.pageSize eq 20 ? 'selected':''}>20</option>
            <option value="50" ${pageParam.pageSize eq 50 ? 'selected':''}>50</option>
            <option value="100" ${pageParam.pageSize eq 100 ? 'selected':''}>100</option>
            <option value="200" ${pageParam.pageSize eq 200 ? 'selected':''}>200</option>
        </select>
        <span>条 , 总记录数: ${pageParam.totalCount} 条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="${pageParam.totalCount}" numPerPage="${pageParam.pageSize}"
         pageNumShown="10" currentPage="${pageParam.pageNum}"></div>
</div>